{% extends "StartGroup/groupHome.html" %}

{% block content %}
    <script type="text/javascript">        
        $(document).ready(function(){
		event_name =  $('#h_en').html();
		event_place =  $('#h_ep').html();
		event_date =  $('#h_ed').html();
		event_desc =  $('#h_edesc').html();
                
		// Assign default event name if exists
		if (event_name){
		    $('#id_event_name').val(event_name);
		}
		
		// Assign default event place if exists
		if (event_place){
		    $('#id_event_place').val(event_place);
		}
		
		// Assign default event date if exists
		if (event_date){
		    $('#id_event_date').val(event_date);
		}
		
		// Assign default event desc if exists
		if (event_desc){		   
		    $('#id_event_desc').val(event_desc);
		}
	    });
    </script>
    <!-- Take hidden values of information form -->
    <div style="display:none;" id="h_en">{{ event.event_name }}</div>
    <div style="display:none;" id="h_ep">{{ event.event_place }}</div>
    <div style="display:none;" id="h_ed">{{ event.event_date }}</div>
    <div style="display:none;" id="h_edesc">{{ event.event_desc }}</div>
    <div class="nobreak eventForm">
        <div class="nobreak eventFormHeader">
	    <div class="eventFormHeaderTitle">Create New Event</div>
	</div>
        <form method="POST" action="{% url groupevents.views.CreateNewEvent %}">
	<div>
	    <div class="nobreak evenFormFieldSection">
	    	<div class="nobreak eventFormFieldLine">
		    <div class="nobreak clearbreak"><span class="startStandardRed">* </span><span><strong>{{ create_event_form.event_name.label_tag }}</strong></span></div>
		    <div class="nobreak clearbreak">{{ create_event_form.event_name }}</div>
		    <p>{{ create_event_form.errors.event_name }}</p>
		</div>
                <div class="nobreak eventFormFieldLine">
		    <div class="nobreak clearbreak"><span class="startStandardRed">* </span><span><strong>{{ create_event_form.event_place.label_tag }}</strong></span></div>
		    <div class="nobreak clearbreak">{{ create_event_form.event_place }}</div>
		    <p>{{ create_event_form.errors.event_place }}</p>
		</div>
        	<div class="nobreak eventFormFieldLine">
		    <div class="nobreak clearbreak"><span class="startStandardRed">* </span><span><strong>{{ create_event_form.event_date.label_tag }}</strong></span></div>
		    <div class="nobreak clearbreak">{{ create_event_form.event_date }}</div>
		    <br />
		    <p>{{ create_event_form.errors.event_date }}</p>
		</div>
	    </div>
	    <div class="nobreak evenFormFieldSection">
		<div class="nobreak eventFormDescFieldLine">
		    <div class="nobreak clearbreak"><span><strong>{{ create_event_form.event_desc.label_tag }}</strong></span></div>
		    <div class="nobreak clearbreak">{{ create_event_form.event_desc }}</div>
		</div>
	    </div>
	</div>
	<div class="nobreak  eventDiscussionButton">
            <input type="submit" value="Update Event Details"  name='updateEvent'/>
	</div>
	</form>
    </div>
    
{% block extra_js %}

<script src="/static_media/contifyuser/js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="/static_media/datepicker/jquery.ui.core.js" type="text/javascript"></script>
<script src="/static_media/datepicker/jquery.ui.datepicker.js" type="text/javascript"></script>
{% endblock %}

{% block extra_css %}
<link href="/static_media/datepicker/datepicker.css" rel="stylesheet" type="text/css"/>
<link href="/static_media/datepicker/jquery.ui.theme.css" rel="stylesheet" type="text/css"/>

{% endblock %}

{% endblock %}
